package net.javlov;

public class ContinuingRewardStatistic implements Statistic {

	protected double[] rewards;
	private int step;
	
	public ContinuingRewardStatistic(int steps) {
		rewards = new double[steps];
		step = 0;
	}
	
	@Override
	public void init() {
		rewards = new double[rewards.length];
		step = 0;
	}

	@Override
	public void reset() {
		rewards = new double[rewards.length];
		step = 0;
	}

	@Override
	public void update(double reward) {
		rewards[step++] = reward;		
	}
	
	public double[] getRewards() {
		return rewards;
	}
}
